import {http} from '@/common/service/service.js'

const gameService = {

    /**
     * 当前比赛
     */
    queryCurGame(memberId, gameType) {
        return http.get('/wx/billiards/game/start?memberId=' + memberId + '&gameType=' + gameType)
    },
    createGame(data) {
        return http.post('/wx/billiards/game', data)
    },
    queryGame(gameId) {
        return http.get('/wx/billiards/game/' + gameId)
    },
    score(data) {
        return http.post('/wx/billiards/game/score', data)
    },
    over(gameId) {
        return http.put('/wx/billiards/game/over/' + gameId)
    },
    list(status) {
        return http.get('/wx/billiards/game?status=' + status)
    },
    join(memberId, gameId) {
        return http.put('/wx/billiards/game/join?gameId=' + gameId + '&memberId=' + memberId)
    },
    myGame(memberId) {
        return http.get('/wx/billiards/game/my/' + memberId)
    }
};

export default gameService;
